package vm;


/**
 * vm
 * @author qj 2009-8-2 16:55
 *
 */
public class Vm {
	public Register GlobalRegister[] = new Register[256];
	public Register TempRegister[] = new Register[256];
	public Register LocalRegister[] = new Register[256];
	public Register InputRegister[] = new Register[256];
	public Register OutputRegister[] = new Register[256];
	public Register FlagsRegister[] = new Register[256];
	public Register PC,SP,FP;
	private static Vm instance = new Vm();
	public Vm()
	{
		PC = new Register("PC",0);
		SP = new Register("SP",0);
		FP = new Register("FP",0);
		for (int i=0;i<256;i++)
		{
			GlobalRegister[i] = new Register("g"+i,0);
			TempRegister[i] = new Register("t"+i,0);
			LocalRegister[i] = new Register("L"+i,0);
			InputRegister[i] = new Register("i"+i,0);
			OutputRegister[i] = new Register("o"+i,0);
			FlagsRegister[i] = new Register("f"+i,0);
		}
	}
	
	public static Vm getInstance()
	{
		return instance;
	}
}
